<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>map循环</title>
</head>

<body>
    <div>map循环</div>
    <hr />
    <div id="demoReact"></div>
</body>
<script src="../../node_modules/babel-standalone/babel.min.js"></script>
<script src="../../node_modules/react/umd/react.development.js"></script>
<script src="../../node_modules/react-dom/umd/react-dom.development.js"></script>
<script type="text/babel">
    let arr = [1,2,3,4,5,6,7];

    let myDom = (
        <div>
            <ul>
                {arr.map(v => <li key={v}>新闻{v}</li>)}
            </ul>
            <ul>
                {arr.map(function(v) {
                    return (
                        <li key={v}>
                            新闻{v}
                        </li>
                    )
                })}
            </ul>
        </div>
    );
    let root = ReactDOM.createRoot(document.getElementById("demoReact"));
    root.render(myDom);
</script>

</html>